package com.changgou.pay.feign;

import com.changgou.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@FeignClient(name = "pay")
public interface PayFeign {

    //下单接口
    @GetMapping("/wxpay/nativePay")
    public Result<Map<String, String>> nativePay(@RequestParam("orderId") String orderId, @RequestParam("money") String money);

    /**
     * 查询微信订单
     * @param orderId
     * @return
     */
    @GetMapping("/wxpay/query/{orderId}")
    public Result<Map<String,String>> queryOrder(@PathVariable String orderId);

    /***
     * 关闭微信订单
     * @param orderId
     * @return
     */
    @PutMapping("/wxpay/close/{orderId}")
    public Result<Map<String, String>> closeOrder(@PathVariable String orderId);
}
